create external table bidefault.tmp_end_network_dispatch_deliver_detail (
   scan_site_code string comment '网点编码' ,
   inpute_date string comment'派件录入日期',
   order_source_code string comment '订单名称',
   deliver_cnt int comment'派件量'
) COMMENT '派件量计算临时表'
STORED AS PARQUET
LOCATION '/dw/hive/bidefault.db/external/tmp_end_network_dispatch_deliver_detail'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);

alter table bidefault.tmp_end_network_dispatch_deliver_detail add columns
(
     agent_code string comment'代理区code'
    ,fran_code string comment'加盟商code'
    ,virt_code string comment'虚拟代理区code'
);
------------------------------------------------------------------------------------


create external table bidefault.tmp_end_network_dispatch_store_detail (
   provider_id string comment '省id' ,
   provider_name string comment '省name' ,
   city_id string comment '城市id' ,
   city_name string comment '城市name' ,
   area_id string comment '区域id' ,
   area_name string comment '区域name' ,
   agent_code string comment '代理区code' ,
   agent_name string comment '代理区name' ,
   franchisee_code string comment '加盟商code' ,
   franchisee_name string comment '加盟商name' ,
   virt_code string comment 'nvl(虚拟代理区,代理区)code' ,
   virt_name string comment 'nvl(虚拟代理区,代理区)名称' ,
   scansitecode string comment '网点code' ,
   inputsite string comment '网点名称' ,
   store_code string comment '门店code' ,
   store_name string comment '门店名称' ,
   store_address string comment '门店地址' ,
   store_phone string comment '门店电话' ,
   business_id string comment '品牌id' ,
   business_name string comment '品牌名称' ,
   source string comment '来源类型：驿站，快递柜' ,
   order_source_code string comment '订单来源名称：桃花岛。' ,
   unique_store_id string comment '上版本保留的唯一键3个',
   build_type string comment '建设类型 1-自建、2-合作、其他建设类型' ,
   store_create_time string comment '门店创建时间' ,
   md_mark string comment '门店唯一标识' ,
   courier_code string comment '业务员code',
   courier_name string comment '业务员code',
   date_time  string comment '日期' ,
   the_third_code string comment '第三段码'
) COMMENT '门店信息整合表'
STORED AS PARQUET
LOCATION '/dw/hive/bidefault.db/external/tmp_end_network_dispatch_store_detail'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);

---------------------------------------------------------------------------------------------